public class MyClass {
         static int a = 10;
                int b = 20;
	
	public static void main(String[] args) {
		MyClass mc1 = new MyClass ();
		
		
		
	   System.out.println(mc1.a + ","+mc1.b);
	     
	     MyClass mc2 = new MyClass ();
			
	     System.out.println(mc2.a + ","+mc2.b);

	}

}







when u declare variable inside method mc1.a, its messing up with int a . thats way static is not gud.























public class MyClass {
         static int a = 10;
                int b = 20;
	
	public static void main(String[] args) {
		MyClass mc1 = new MyClass ();
		
		mc1.a=11;
	    mc1.b=21;
		
	     System.out.println(mc1.a + ","+mc1.b);
	     
	     MyClass mc2 = new MyClass ();
			
	     System.out.println(mc2.a + ","+mc2.b);

	}

}
